#ifndef WF_POLYLINETRIM_H
#define WF_POLYLINETRIM_H

#include "pf_previewactioninterface.h"
#include "pf_modification.h"
#include "gui_export.h"

/**
 * This action class can handle user events to move entities.
 *
 */
class GUI_EXPORT WF_PolylineTrim : public PF_PreviewActionInterface {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
    	ChooseEntity,			/**< Choosing existing polyline to trim. */
        SetSegment1,    /**< Setting first segment. */
        SetSegment2       /**< Setting second segment. */
    };

public:
    WF_PolylineTrim(PF_Container& container,
                        PF_GraphicView& graphicView);
    ~WF_PolylineTrim() {}

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

    virtual void init(int status=0);
	
    virtual void trigger();
	
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

private:
    PF_Entity* delEntity;
	PF_AtomicEntity* Segment1;
	PF_AtomicEntity* Segment2;
};

#endif
